package cn.mxp.a01_singleton;

import org.junit.Test;

public class SingletonTest {
    @Test
    public void test01() {
        for (int i = 0; i < 10; i++) {
            new Thread(() -> {
                System.out.println(Singleton01.getInstance());
            }).start();
        }
    }

    @Test
    public void test02() {
        for (int i = 0; i < 10; i++) {
            new Thread(() -> {
                System.out.println(Singleton02.getInstance());
            }).start();
        }
    }

    @Test
    public void test03() {
        for (int i = 0; i < 10; i++) {
            new Thread(() -> {
                System.out.println(Singleton03.getInstance());
            }).start();
        }
    }

    @Test
    public void test04() {
        for (int i = 0; i < 10; i++) {
            new Thread(() -> {
                System.out.println(Singleton04.getInstance());
            }).start();
        }
    }

    @Test
    public void test05() {
        for (int i = 0; i < 10; i++) {
            new Thread(() -> {
                System.out.println(Singleton05.INSTANCE.getInstance());
            }).start();
        }
    }
}
